/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package accountmanager.controller;

import accountmanager.dao.Cliente;
import accountmanager.dao.ifc.ClienteDAO;
import accountmanager.factory.Factory;
import java.util.ArrayList;

/**
 *
 * @author afonso
 */
public class GerenciaClientes {

    private ArrayList<Cliente> clientes = new ArrayList<Cliente>();

    private Factory factory;

    private ClienteDAO clienteDAO;

    public GerenciaClientes() {
        factory = new Factory();
        clienteDAO = factory.createClienteDAO();
    }

    public Cliente buscaClienteCpf(long cpf) {
        return clienteDAO.buscaClienteCpf(cpf);
    }

    public ArrayList<Cliente> buscaTodosCliente() {
        return clienteDAO.buscaTodosCliente();
    }

    public String cadastraCliente(long cpf, String nome) {
        if (clienteDAO.cadastraCliente(cpf, nome))
            return "Cliente cadastrado com sucesso";
        else
            return "Cliente já existe nem nossas bases de dados";
    }

}
